home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWDebug / Sources / FWLibMai.cpp < prev    next >
Encoding:
Text File  |  1994-04-21  |  1.6 KB  |  70 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWLibMai.cpp
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifdef FW_BUILD_WIN
  13.  
  14. #include <Windows.h>
  15.  
  16. // prevent LibMain from being mangled
  17.  
  18. extern "C"
  19. {
  20. #ifdef FW_BUILD_WIN16
  21.     BOOL CALLBACK LibMain(HANDLE    hInstance,
  22.                           WORD        wDataSeg,
  23.                           WORD        cbHeap,
  24.                           LPSTR        lpszCmdLine);
  25. #endif
  26. #ifdef FW_BUILD_WIN32S
  27.     BOOL WINAPI DllMain(HANDLE    hDLL,
  28.                         DWORD    dwReason,
  29.                         LPVOID    lpReserved);
  30.     void _cinit();            // static constructors
  31.     void _dodtors();        // static destructors
  32. #endif
  33. };
  34.  
  35. #ifdef FW_BUILD_WIN16
  36. //----------------------------------------------------------------------------------------
  37. // LibMain
  38. //----------------------------------------------------------------------------------------
  39. BOOL CALLBACK LibMain(HANDLE         hInstance,
  40.                       WORD        /* wDataSeg        */,
  41.                       WORD        /* cbHeap        */,
  42.                       LPSTR        /* lpszCmdLine    */)
  43. {
  44.     return hInstance != NULL;
  45. }
  46. #endif
  47.  
  48. #ifdef FW_BUILD_WIN32S
  49.  
  50. #pragma DOSSEG
  51. #pragma startaddress(DllMain)
  52.  
  53. //----------------------------------------------------------------------------------------
  54. // DllMain
  55. //----------------------------------------------------------------------------------------
  56. BOOL WINAPI DllMain(HANDLE    /* hDLL            */,
  57.                     DWORD        dwReason,
  58.                     LPVOID    /* lpReserved    */)
  59. {
  60.     if(dwReason == DLL_PROCESS_ATTACH)
  61.         _cinit();
  62.     else if(dwReason == DLL_PROCESS_DETACH)
  63.         _dodtors();
  64.  
  65.     return TRUE;
  66. }
  67. #endif
  68.  
  69. #endif
  70.